<template>
      <div>
  <img :src="imgUrl" v-loading="loading"/>

      </div>
</template>
<script>

export default {
props:["message"],
  data() {
    return {
      dialogVisible: false,
      params: '',
      imgUrl: {},
      url: "",
      loading: true
    };
  },
  methods: {
    //获取本机的网络ip地址
    pcip(){
      this.$http.get("/pcip").then(res=>{
         this.url="http://"+res.data+":8082/alipaytest?message="+this.message
        //调用方法 拿到修饰后的支付宝沙箱二维码
        this.loading = true;
        this.$http
            .get('/createLogoQRCode', {
              params: {
                url: this.url,
              },
              responseType: 'blob'
            })
            .then((response) => {
              this.imgUrl = window.URL.createObjectURL(response.data);
              this.loading = false;
            })
            .catch((error) => {
              console.log(error);
            });
      })
    }

  ,
  },created() {
  this.pcip();
  },

};
</script>